.TH zzat 1 "2015-01-06" "zzat @PACKAGE_VERSION@"
.SH NAME
zzat \- concatenate files using different instruction sequences
.SH SYNOPSIS
\fBzzat\fR [\fB\-AbdeEntTv\fR] [\fB\-r\fR \fIloops\fR]
[\fB\-x\fR \fIsequence\fR] [\fIFILE\fR]...
.br
\fBzzat \-l\fR | \fB\-\-list\fR
.br
\fBzzat \-h\fR | \fB\-\-help\fR
.br
\fBzzat \-V\fR | \fB\-\-version\fR
.SH DESCRIPTION
.PP
The \fBzzat\fR utility reads files sequentially, writing them to the
standard output. The user can decide which sequence of library calls is
used to seek and read data.

\fBzzat\fR is primarily used as a debugging tool for \fBzzuf\fR, because
it can emulate different programs' ways to read files.
.SH OPTIONS
.TP
\fB\-A\fR, \fB\-\-show\-all\fR
Equivalent to \fB\-vET\fR.
.TP
\fB\-b\fR, \fB\-\-number\-nonblank\fR
Number nonempty output lines.
.TP
\fB\-d\fR, \fB\-\-debug\fR
Output debugging information.
.TP
\fB\-e\fR
Equivalent to \fB\-vET\fR.
.TP
\fB\-E\fR, \fB\-\-show\-ends\fR
Display $ at end of each line.
.TP
\fB\-n\fR, \fB\-\-number\fR
Number all output lines.
.TP
\fB\-r\fR, \fB\-\-repeat\fR=\fIloops\fR
Concatenate all files \fIloops\fR times.
.TP
\fB\-t\fR
Equivalent to \fB\-vT\fR.
.TP
\fB\-T\fR, \fB\-\-show\-tabs\fR
Display TAB characters as ^I.
.TP
\fB\-v\fR, \fB\-\-show\-nonprinting\fR
Use ^ and M- notation, except for LFD and TAB.
.TP
\fB\-x\fR, \fB\-\-execute\fR=\fIsequence\fR
Read a file or a stream using the instruction sequence specified in
\fIsequence\fR.

Instructions are executed sequentially until the end of the program.
End-of-file is not an exit condition, except where the \fBfeof\fR keyword is
used:

\fB    fread(1,10); feof(1); fread(1,10)\fR

Loops are permitted using the \fBrepeat\fR keyword. Again, \fBfeof\fR can be
used to prematurely break out of a loop:

\fB    repeat(10000, fgetc() feof(1))\fR

Instructions can be separated by spaces, commas or semicolons.
A list of all available instructions and control keywords can be obtained
using this command:

\fB    zzat \-l\fR

If no sequence is specified, the following default sequence is used:

\fB    repeat(\-1, fread(1,32768), feof(1))\fR

.TP
\fB\-l\fR, \fB\-\-list\fR
Display the list of supported keywords and functions and exit.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display a short help message and exit.
.TP
\fB\-V\fR, \fB\-\-version\fR
Output version information and exit.
.SH EXAMPLES
.PP
Read the first 1000 bytes of f, then exit:
.PP
\fB    zzat \-x \(aqfread(1,1000)\(aq f\fR
.PP
Read the first four bytes of f, using four different instructions:
.PP
\fB    zzat \-x \(aqgetc(),fgetc(),getc_unlocked(),_IO_getc()\(aq f\fR
.PP
Read f entirely, by calling \fBgetc()\fR repeatedly until end-of-file is
reached:
.PP
\fB    zzat \-x \(aqrepeat(\-1, getc(), feof(1))\(aq \fRf
.PP
Read f entirely, in chunks of 32768 bytes until end-of-file is reached:
.PP
\fB    zzat \-x \(aqrepeat(\-1, fread(1,32768), feof(1))\(aq \fRf
.\" .PP
.\" Read only odd bytes, rewind file, then read all even bytes:
.\" .PP
.\" \fB    zzat \-x \(aqrepeat(\-1, getc(), feof(1), fseek(1,SEEK_CUR)),
.\" \fB              rewind(),
.\" \fB              repeat(\-1, fseek(1,SEEK_CUR), getc(), feof(1))\(aq
.SH SEE ALSO
.PP
\fBzzuf(3)\fR, \fBlibzzuf(3)\fR
.SH AUTHOR
.PP
Copyright \(co 2002\-2015 Sam Hocevar <sam@hocevar.net>.
.PP
\fBzzat\fR and this manual page are free software. They come without any
warranty, to the extent permitted by applicable law. You can redistribute
them and/or modify them under the terms of the Do What the Fuck You Want
to Public License, Version 2, as published by the WTFPL Task Force. See
\fBhttp://www.wtfpl.net/\fR for more details.
.PP
\fBzzuf\fR's webpage can be found at \fBhttp://caca.zoy.org/wiki/zzuf\fR.
An overview of the architecture and inner works is at
\fBhttp://caca.zoy.org/wiki/zzuf/internals\fR.
